<html xmlns:saxon="http://icl.com/saxon">
   <head>
      <link rel="stylesheet" type="text/css" href="doc.css"/>
      <link rel="stylesheet" type="text/css" href=""/>
      <meta author="The MathWorks Ltd."/>
      <meta copyright="2011 The MathWorks Ltd."/>
      <title>Setting defaults for all windows</title>
   </head>

   
    <body>
      <table class="header" width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
            <td bgcolor="#e4f0f8"><A href="User guide.html"><font face="Arial" bgcolor="#e4f0f8" size="+0" underline="0" color="#000000"><b>User guide</b></font></A></td>
            <td width="36" bgcolor="#e4f0f8"><A HREF="User guide4_1.html"><IMG SRC="Images/leftarrow.png" BORDER="0" ALT="previous page"/></A><A HREF="User guide5.html"><IMG SRC="Images/rightarrow.png" BORDER="0" ALT="next page"/></A></td>
         </tr>
      </table>
   

      <br clear="all"/>
          
      <h2>4.2: Setting defaults for all windows&nbsp;<a href="User guide4.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></a></h2>
      
            <p>As well as modifying the <a href="FigureDefaults.html">defaults used in one window</a>,
        it is possible to override the defaults used for all windows. This makes use of
    the special "0" handle that roughly corresponds to the MATLAB environment. Note, however,
that defaults set at the window level take precedence.</p>
            <p>The example below shows how defaults can be set for the panel title-bar color
            and font for all windows, but the font size is overridden for the second window:</p>
            <example>
                <pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011"><a href="uiextras.set.html"><code class="FUNCTION">uiextras.set</code></a>( 0, <code class="STRING">'DefaultHBoxBackgroundColor'</code>, [0.3 0.3 0.3] );
<a href="uiextras.set.html"><code class="FUNCTION">uiextras.set</code></a>( 0, <code class="STRING">'DefaultBoxPanelTitleColor'</code>, <code class="STRING">'y'</code> );
<a href="uiextras.set.html"><code class="FUNCTION">uiextras.set</code></a>( 0, <code class="STRING">'DefaultBoxPanelFontSize'</code>, 14 );
f1 = <a href="matlab:doc figure"><code class="FUNCTION">figure</code></a>();
h = <a href="uiextras.HBox.html"><code class="FUNCTION">uiextras.HBox</code></a>( <code class="STRING">'Parent'</code>, f1, <code class="STRING">'Padding'</code>, 10, <code class="STRING">'Spacing'</code>, 10 );
p1 = <a href="uiextras.BoxPanel.html"><code class="FUNCTION">uiextras.BoxPanel</code></a>( <code class="STRING">'Parent'</code>, h, <code class="STRING">'Title'</code>, <code class="STRING">'Panel 1'</code> );
p2 = <a href="uiextras.BoxPanel.html"><code class="FUNCTION">uiextras.BoxPanel</code></a>( <code class="STRING">'Parent'</code>, h, <code class="STRING">'Title'</code>, <code class="STRING">'Panel 2'</code> );
f2 = <a href="matlab:doc figure"><code class="FUNCTION">figure</code></a>();
<a href="uiextras.set.html"><code class="FUNCTION">uiextras.set</code></a>( f2, <code class="STRING">'DefaultBoxPanelFontSize'</code>, 20 );
p3 = <a href="uiextras.BoxPanel.html"><code class="FUNCTION">uiextras.BoxPanel</code></a>( <code class="STRING">'Parent'</code>, f2, <code class="STRING">'Title'</code>, <code class="STRING">'Panel 3'</code> );</font></pre>
            <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/DefaultsSystem1.png"/><img src="Images/DefaultsSystem2.png"/></center></font></p>
            </example>
            <p>It is important to note that although the default has been set
            system-wide, it is not preserved between MATLAB sessions.</p>
        
      
      <br clear="ALL"/>
      <table class="footer" width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
            <td width="18" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide4_1.html"><img src="images/leftarrow.png" border="0" alt="previous page"/></a></td>
            <td width="40%" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide4_1.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Setting defaults for one window</font></a></td>
            <td width="20%" height="15" bgcolor="#e4f0f8" align="center"><a href="index.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">[Top]</font></a></td>
            <td width="40%" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide5.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Advanced maneuvers with panels</font></a></td>
            <td width="18" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide5.html"><img src="images/rightarrow.png" border="0" alt="next page"/></a></td>
         </tr>
      </table>
      <font face="Arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">&copy; 2011 The MathWorks Ltd</font>
      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/license.txt'])">Terms of Use</a>
      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/patents.txt'])">Patents</a>
      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/trademarks.txt'])">Trademarks</a>
   
   </body>
</html>

            
